<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>省钱控-最新优惠</title>
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/sea-buy.css">
  <script src="../lib/jquery/jquery-1.12.4.js"></script>

</head>
<body>
   <!-- 省钱控列表的头部 -->
   <header>
      <div class="back_away"><a class="iconfont" href="javascript:;">&#xe7eb;</a></div>
      <div class="price_title">白菜价-淘宝内部券</div>
      <div class="dowload"><a href="javascript:;"><span class="iconfont">&#xe640;</span><p>APP下载</p></a></div>
  </header>

 
   <!-- 中间数据渲染 -->
   <div id="nav-bar" class="clearfix">
       
   </div>

   <!-- 分页 -->
   

   <!-- 底部 -->
   <footer>
    <div class="footer-top">
        <ul>
            <li>登录</li>
            <li>注册</li>
            <li class="go">返回顶部</li>
        </ul>
    </div>
    <div class="footer-footer">
        <div class="shouji">
            <a href="javascript:;">手机APP下载</a>
            <a href="javascript:;"> 慢慢买手机版</a>
            <a href="javascript:;">-掌上比价平台</a>
        </div>
        <a href="javascript:;">m.mammambuy.com</a>

    </div>
</footer>
</body>
</html>
<script src="../js/htmlFont.js"></script>
<script src="../lib/template/template.js"></script>
<script src="../lib/jquery/jquery-1.12.4.js"></script>
<script type="text/template" id="moneyListTmp">
  <!-- 此模板是省钱控的数据模板 -->
{{each result as val key}}
<a href="./detail.html?id={{val.productId}}" class="nav-content fl">
    <!-- 左边 -->
     <div class="productImgSm fl">{{val.productImgSm}}</div>
     <!-- 右边 -->
     <div class="text fl">
     <div class="title fl"><span class="productName fl">{{val.productName}}</span><span class="productPinkage">{{val.productPinkage}}</span></div>
     <div class="target fl">
         <span class="productFrom fl">{{val.productFrom}}</span><span class="fl">|</span><span class="productTime fl">{{val.productTime}}</span><span class="productComCount fr">{{val.productComCount}}</span>
       </div>
     </div>
    </a>
{{/each}}
</script>
<script>
  // 1.渲染数据
     $.ajax({
       type:"post",
       url:'http://193.112.55.79:9090/api/getmoneyctrl',  // 请求的目标地址
       dataType:'jsonp',
       success:function (res) {
        //  console.log(res);
           // 准备模板字符串
           template.config("escape", false);
           var htmlStr = template('moneyListTmp',res);
           // 动态渲染数据
           $('#nav-bar').html(htmlStr);
       }
     })             
</script>
<script>
  $(function() {
       /* 需求模板：当__按钮__被__点击__时，效果是__返回顶部__ */
       $('.go').click(function() {
           $('html,body').stop().animate({
               scrollTop: 0
           });
       });
   });
</script>